package com.esri.core.tasks.ags.geoprocessing;

import com.esri.core.internal.tasks.TaskListener;
import com.esri.core.internal.tasks.d;
import com.esri.core.io.EsriServiceException;
import com.esri.core.io.UserCredentials;

/* loaded from: classes.dex */
class GetGPServiceInfoTask extends d<GPServiceInfo> {
    private static final long serialVersionUID = 1;

    public GetGPServiceInfoTask(GPBasicTaskParameters gPBasicTaskParameters, String str, UserCredentials userCredentials) {
        this(gPBasicTaskParameters, str, userCredentials, null);
    }

    public GetGPServiceInfoTask(GPBasicTaskParameters gPBasicTaskParameters, String str, UserCredentials userCredentials, TaskListener<GPServiceInfo> taskListener) {
        super(gPBasicTaskParameters, str, userCredentials, taskListener);
        if (gPBasicTaskParameters == null) {
            throw new EsriServiceException("The get GP service info task requires input parameters");
        }
        if (gPBasicTaskParameters.validate()) {
            return;
        }
        setActionInput(null);
    }

    @Override // com.esri.core.internal.tasks.a
    public GPServiceInfo execute() throws Exception {
        return GPServiceInfo.fromUrl(this.serviceURL, this.credentials);
    }
}
